package main

import (
	"fmt"
	"os"
)

func main() {
	tree("D:/pycharm", "")
}

func tree(dir string, incent string) {
	content, _ := os.ReadDir(dir)
	incent += "  "
	for _, i := range content {
		if i.IsDir() {
			fmt.Printf("%s%s/\n", incent, i.Name())
			str1 := fmt.Sprintf("%s/%s", dir, i.Name())
			tree(str1, incent)
		} else {
			fmt.Println(incent, i.Name())
		}
	}
}
